<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type=text/css>
body{cursor:default}
td{font-size:12;font-family:arial;text-align:center}
td.dt{font-size:11;font-family:arial;text-align:center}
a{color:blue}
a:hover{color:red}
a.bt{color:#888888}
</style>
<script language=javascript>
<!--//
var str='',i,j,yy,mm,maxdays;
var wp=window.parent;
var cf=wp.document.getElementById("CalFrame");
var fld,curday,today=new Date();
today.setHours(0);today.setMinutes(0);today.setSeconds(0);today.setMilliseconds(0);
function parseDate(s)
{
 var reg=new RegExp("[^0-9-]","")
 if(s.search(reg)>=0)return today;
 var ss=s.split("-");
 if(ss.length!=3)return today;
 if(isNaN(ss[0])||isNaN(ss[1])||isNaN(ss[2]))return today;
 return new Date(parseFloat(ss[0]),parseFloat(ss[1])-1,parseFloat(ss[2]));
}
function resizeCalendar(){cf.width=144;cf.height=192;}
function initCalendar(maxDays)
{
 maxdays=maxDays;
 if(fld&&fld.value.length>0){curday=parseDate(fld.value);}
 else curday=today;
 drawCalendar(curday.getFullYear(),curday.getMonth());
}
function drawCalendar(y,m)
{
 var x=new Date(y,m,1),mv=x.getDay(),d=x.getDate(),de;
 yy=x.getFullYear();mm=x.getMonth();
 document.getElementById("yyyymm").innerHTML=yy+"年"+(mm+1>9?mm+1:"0"+(mm+1))+"月";
 for(var i=1;i<=mv;i++)
 {
  de=document.getElementById("d"+i);
  de.innerHTML="";
  de.bgColor="";
 }
 var t1=curday.getTime();
 var t2=today.getTime();
 while(x.getMonth()==mm)
 {
  de=document.getElementById("d"+(d+mv));
  de.innerText=d;
  var t3=x.getTime();
  var des=de.style;
  if(t3==t2)
  {
   /*des.fontWeight="normal";
   des.color="OrangeRed";*/
   des.color="OrangeRed";
   des.fontWeight="bold";
   des.cursor="hand";
   de.onclick=setDate;
  }
  /*
  else if(t3<t2 || t3>t2+1000*60*60*24*maxdays)
  {
   des.fontWeight="normal";
   des.color="DarkGray";
   des.cursor="default";
   de.onclick=null;
  }
  */
  else
  {
   des.color="blue";
   des.fontWeight="bold";
   des.cursor="hand";
   de.onclick=setDate;
  }
  if(t3==t1 && t1!=t2)
  {
   de.bgColor="Orange";
   des.color="white";
  }
  else
  {
   de.bgColor="white";
  }
  x.setDate(++d);
 }
 while(d+mv<=42)
 {
  de=document.getElementById("d"+(d+mv));
  de.innerHTML="";
  de.bgColor="";
  d++;
 }
}
function setDate()
{
 var d = event.srcElement.innerText;
 var dstr=yy+"-"+(mm+1>9?mm+1:"0"+(mm+1))+"-"+((d>9)?d:"0"+d);
 fld.value=dstr;
 wp.hideCalendar();
}
function clear()
{
fld.value="";
wp.hideCalendar();
}
//-->
</script>
</head>

<body topmargin=0 leftmargin=0 bottommargin=0 rightmargin=0 onload="resizeCalendar();">
<table id=tbl0 bgcolor=Gray border=0 cellpadding=1 cellspacing=0><tr><td>
<table width=100% border=0 cellpadding=2 cellspacing=0>
<tr bgcolor=WhiteSmoke>
<td width=16 id=prev><a href=javascript:drawCalendar(yy,mm-1);><img src='prev.gif' border=0 width="16" height="16"></a></td>
<td width=99% id=yyyymm style=font-size:11;color:Blue;font-weight:bold></td>
<td width=16 id=next><a href=javascript:drawCalendar(yy,mm+1);><img src='next.gif' border=0 width="16" height="16"></a></td>
</tr>
</table>
<table width=142 border=0 bgcolor=white cellpadding=0 cellspacing=2>
<tr height=18><td width=18><font color=red>日</font></td><td width=18>一</td><td width=18>二</td><td width=18>三</td><td width=18>四</td><td width=18>五</td><td width=18><font color=green>六</font></td></tr>
<tr height=1><td colspan=7 bgcolor=gray></td></tr>
<script language=javascript>
<!--//
for(i=0;i<6;i++)
{
 str+="<tr height=18>";
 for(j=1;j<=7;j++)str+="<td id=d"+(i*7+j)+" class=dt></td>";
 str+="</tr>";
}
document.write(str);
//-->
</script>
<tr height=1><td colspan=7 bgcolor=gray></td></tr>
<tr height=18><td colspan=7><a href="javascript:wp.hideCalendar();">关闭</a>&nbsp;&nbsp;<a href="javascript:clear();">清空</a></td></tr>
</table>
</td></tr></table>
<script language=javascript>
<!--//
var bCalLoaded=true;
//-->
</script>
</body>
</html>
